/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package ims.dashboard;

import ims.zoo.*;
import ims.banking.*;
import ims.restaurant.*;

import ims.shape.ShapeFileFrame;
import ims.shape.AnimalChartFrame;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.HashMap;
import ims.shape.ShapeFrame;

public class MainDashboard extends JFrame {

    private ZooManager zooManager;
    private BankingService bankingService;
    private RestaurantService restaurantService;
    private ims.shape.ShapeService shapeService;  

    public MainDashboard() {
        zooManager = new ZooManager();
        bankingService = new BankingService();
        restaurantService = new RestaurantService();
        shapeService = new ims.shape.ShapeService();

        setTitle("Integrated Management System (IMS) Dashboard");
        setSize(400, 300);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLocationRelativeTo(null);

        JButton zooButton = new JButton("Zoo Management");
        JButton bankingButton = new JButton("Banking Service");
        JButton restaurantButton = new JButton("Restaurant Service");
        JButton shapeButton = new JButton("Shape Service");

        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(4, 1, 10, 10));
        panel.add(zooButton);
        panel.add(bankingButton);
        panel.add(restaurantButton);
        panel.add(shapeButton);

        add(panel);

        // Zoo Button
        zooButton.addActionListener(e -> {
    ZooManagementFrame frame = new ZooManagementFrame(zooManager, bankingService);
    frame.setVisible(true);
});


        // Banking Button
        bankingButton.addActionListener(e -> {
    BankingFrame frame = new BankingFrame(bankingService);
    frame.setVisible(true);
});


        // Restaurant Button
        restaurantButton.addActionListener(e -> {
    RestaurantFrame frame = new RestaurantFrame(restaurantService, bankingService);
    frame.setVisible(true);
});



   JButton animalChartButton = new JButton("Animal Chart");
panel.add(animalChartButton);

animalChartButton.addActionListener(e -> {
    AnimalChartFrame chart = new AnimalChartFrame(zooManager);
    chart.setVisible(true);
});

       shapeButton.addActionListener(e -> {
    ShapeFileFrame frame = new ShapeFileFrame(shapeService);
    frame.setVisible(true);
});



    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            MainDashboard dashboard = new MainDashboard();
            dashboard.setVisible(true);
        });
    }
}
